#include "TilePropertyAction.hpp"

TilePropertyAction::TilePropertyAction(byte* prop, byte val, int tilex, int tiley){
    desc = "Set (" + StringHelper::itos(tilex) + "," + StringHelper::itos(tiley) + 
            ") property to " + StringHelper::itos(val);
    target = prop;
    originalValue = *target;
    newValue = val;
    perform();
}

void TilePropertyAction::perform(){
    *target = newValue;
}

void TilePropertyAction::undo(){
    *target = originalValue;
}